package org.ohuyo.libra.server.model.table;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type;

/**
 * session attribute锟斤拷
 * 
 * @author rabbit
 * 
 */

@Entity
@Table(name = "T_ATTRIBUTE")
@org.hibernate.annotations.Table(appliesTo = "T_ATTRIBUTE", indexes = {
		@Index(name = "idx_attribute1", columnNames = { "login_ticket", "key_name",
				"src_app_code", "target_app_code" }),
		@Index(name = "idx_attribute2", columnNames = { "login_ticket" }) })
public class AttributeRecord implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1584820560899091792L;

	@Id
	@TableGenerator(name = "t_attribute", table = "t_libra_seq", pkColumnName = "seq_name", pkColumnValue = "t_session", valueColumnName = "next_value", initialValue = 0, allocationSize = 100)
	@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "t_attribute")
	@Column(name = "i_attribute", nullable = false, updatable = false)
	private long iAttribute;

	/**
	 * 锟斤拷陆票锟斤拷
	 */
	@Column(name = "login_ticket", nullable = false, updatable = false)
	private Long loginTicket;

	/**
	 * 原应锟矫达拷锟斤拷(锟斤拷锟矫革拷attribute锟斤拷应锟斤拷)
	 */
	@Column(name = "src_app_code", columnDefinition = "varchar(20)", nullable = false, updatable = false)
	private String srcAppCode;

	/**
	 * 目锟斤拷应锟矫达拷锟斤拷(锟斤拷锟皆讹拷取锟斤拷attribute锟斤拷应锟斤拷)
	 */
	@Column(name = "target_app_code", columnDefinition = "varchar(20)", updatable = false)
	private String targetAppCode;

	/**
	 * key
	 */
	@Column(name = "key_name", columnDefinition = "varchar(255)", nullable = false, updatable = false)
	private String keyName;

	/**
	 * value锟斤拷小锟斤拷志
	 */
	@Column(name = "short_flg", columnDefinition = "char(1)", nullable = false)
	@Type(type = "org.hibernate.type.YesNoType")
	private Boolean shortFlag;

	/**
	 * value
	 */
	@Column(name = "value", columnDefinition = "varchar(255)")
	private String value;

	/**
	 * 锟斤拷锟绞憋拷锟�	 */
	@Column(name = "gen_time", nullable = false)
	private Date genTime;

	/**
	 * 一锟斤拷锟皆憋拷志
	 */
	@Column(name = "disposable", columnDefinition = "char(1)", nullable = false, updatable = false)
	@Type(type = "org.hibernate.type.YesNoType")
	private Boolean disposable;

	/**
	 * 锟斤拷锟斤拷锟街�	 */
	@Column(name = "shared", columnDefinition = "char(1)", nullable = false, updatable = false)
	@Type(type = "org.hibernate.type.YesNoType")
	private Boolean shared;

	/**
	 * 锟斤拷锟斤拷时锟斤拷
	 */
	@Column(name = "upd_time", nullable = false)
	private Date updTime;

	public long getiAttribute() {
		return iAttribute;
	}

	public void setiAttribute(long iAttribute) {
		this.iAttribute = iAttribute;
	}

	public Long getLoginTicket() {
		return loginTicket;
	}

	public void setLoginTicket(Long loginTicket) {
		this.loginTicket = loginTicket;
	}

	public String getSrcAppCode() {
		return srcAppCode;
	}

	public void setSrcAppCode(String srcAppCode) {
		this.srcAppCode = srcAppCode;
	}

	public String getTargetAppCode() {
		return targetAppCode;
	}

	public void setTargetAppCode(String targetAppCode) {
		this.targetAppCode = targetAppCode;
	}



	public String getKeyName() {
		return keyName;
	}

	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Date getGenTime() {
		return genTime;
	}

	public void setGenTime(Date genTime) {
		this.genTime = genTime;
	}

	public Date getUpdTime() {
		return updTime;
	}

	public void setUpdTime(Date updTime) {
		this.updTime = updTime;
	}

	public Boolean getDisposable() {
		return disposable;
	}

	public void setDisposable(Boolean disposable) {
		this.disposable = disposable;
	}

	public Boolean getShared() {
		return shared;
	}

	public void setShared(Boolean shared) {
		this.shared = shared;
	}

	public Boolean getShortFlag() {
		return shortFlag;
	}

	public void setShortFlag(Boolean shortFlag) {
		this.shortFlag = shortFlag;
	}

}
